import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'
import Home from '../views/Home.vue'
import LayoutView from "@/views/layout/LayoutView.vue"
import TopicView from "@/views/topic/TopicView.vue"
import HomeView from "@/views/home/HomeView.vue"
import CategoryView from "@/views/category/CategoryView.vue"

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    component: LayoutView,
    redirect: "/index",
    children: [{
      path: "/index",
      component: HomeView,
      name: "Home"
    }]
  },
  {
    path: '/topic',
    component: LayoutView,
    redirect: "/topic/index",
    children: [{
      path: "/topic/index",
      component: TopicView,
      name: "Topic"
    }]
  },
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
